<?
					$cnt=0;
					$tongcong=0;
					$cart=$_SESSION['cart'];if ($cart<>'')
                    {
    					foreach ($cart as $product)
                        {
    						$sql = "select * from tbl_product where id='".$product[0]."'";
    						$result = mysql_query($sql,$conn);
    						if (mysql_num_rows($result)>0)
                            {
    						  $pro = mysql_fetch_assoc($result)?>
                              <?
                                  
                            }
    					       $tongcong=$tongcong+$product[1];
    					       $cnt=$cnt+1;
    					} 
                        echo($tongcong);
                    }				
?>